import React, { Component } from 'react';
import { Switch, Route } from 'react-router-dom';
import { Router } from './../../config/router.js';
import CommentModule from './comment.module.scss';
import Product from './product/Product.js';
import Merchant from './merchant/Merchant.js';

class Comment extends Component {

	componentWillMount() {
		console.log(this)
		// 自动跳转到商户评论页面
		// TODO
	}
	componentDidMount() {}
	componentWillReceiveProps(newProps) {}
	shouldComponentUpdate(newProps, newState) {
		return true;
	}
	componentWillUpdate(nextProps, nextState) {}
	componentDidUpdate(prevProps, prevState) {}
	componentWillUnmount() {}

	render() {
		return (
			<div className={CommentModule.Comment}>
				<Switch>
					<Route path={ Router.client.comment.product.path } component={ Product }/>
					<Route path={ Router.client.comment.merchant.path } component={ Merchant }/>
				</Switch>
			</div>
		);
	}
}

export default Comment;